/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package edu.ccut.titan.component;

import org.osgi.framework.Bundle;

/**
 * Record bundle root directory information. in root directory should exist a
 * file name ".titan" to exist needed information.
 * 
 * <p>
 * Directory type include:
 * <li>1. TITAN_DIRECTORY_TYPE_WEB : web type
 * <li>2. TITAN_DIRECTORY_TYPE_ACTION : action type
 * <li>3. TITAN_DIRECTORY_TYPE_LOGIC : logic type
 * <li>4. TITAN_DIRECTORY_TYPE_DATE : date type
 * 
 * @author LeslieGu
 * 
 */
public interface IDirectoryInfo {

	public static final String TITAN_DIRECTORY_INFO_NAME = ".titan";

	public static final String TITAN_DIRECTORY_TYPE_WEB = "web";

	public static final String TITAN_DIRECTORY_TYPE_ACTION = "action";

	public static final String TITAN_DIRECTORY_TYPE_LOGIC = "logic";

	public static final String TITAN_DIRECTORY_TYPE_DATE = "date";
	
	public static final String TITAN_DIRECTORY_TYPE_COMPONENT = "component";

	/**
	 * Get version
	 * 
	 * @return
	 */
	public String getVersion();
	
	/**
	 * Set version
	 * @param version
	 */
	public void setVersion(String version);

	/**
	 * Get description
	 * 
	 * @return
	 */
	public String getDescription();

	/**
	 * Set description
	 * 
	 * @param description
	 */
	public void setDescription(String description);
	
	/**
	 * Get directory type
	 * 
	 * @return
	 */
	public String getType();

	/**
	 * Get create time
	 * 
	 * @return
	 */
	public String getTime();
	
	/**
	 * Set create time
	 * 
	 * @param time
	 */
	public void setTime(String time);

	/**
	 * Get directory path
	 * 
	 * @return
	 */
	public String getDirectoryPath();
	
	/**
	 * Set directory path
	 * 
	 * @param path
	 */
	public void setDirectoryPath(String path);
	
	public void load(Bundle bundle, IBundleInfo bundleInfo) throws TitanComponentException;

	public void unload(Bundle bundle, IBundleInfo bundleInfo) throws TitanComponentException;
}
